try:
    from bot.openai_bot import OpenAIBot
    from conf.config import config
    from writing.writing import writing_by_newbing, writing_by_openai
except ModuleNotFoundError:
    import os
    import sys
    sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))  # 离开IDE也能正常导入自己定义的包

    from bot.openai_bot import OpenAIBot
    from conf.config import config
    from writing.writing import writing_by_newbing, writing_by_openai


def main():

    if config.get("bot") == "newbing":
        writing_by_newbing()
    elif config.get("bot") == "openai":
        writing_by_openai()
    else:
        raise Exception(f"目前只支持newbing和openai机器人，请修改config.json文件中bot字段的内容")


if __name__ == '__main__':
    main()
